import os
import logging

def delete_files_in_folder(folder_path: str) -> None:
    """递归删除指定文件夹及其子文件夹中的所有文件（保留文件夹结构）"""
    deleted_count = 0

    for root, dirs, files in os.walk(folder_path):
        for filename in files:
            if filename == ".gitkeep":
                continue
            file_path = os.path.join(root, filename)
            try:
                os.unlink(file_path)
                deleted_count += 1
            except Exception as e:
                logging.exception(f"删除文件时出错: {file_path} -> {e}")

    logging.info(f"√ 已删除 {deleted_count} 个文件（保留目录结构）")
